//
//  BySuperSectionView.m
//  caipiao_ios
//
//  Created by mc on 2018/7/12.
//  Copyright © 2018年 ZhangZhanbin. All rights reserved.
//

#import "BySuperSectionView.h"

@implementation BySuperSectionView

- (id)init{
    self = [super init];
    if (self) {
        
        self.titleLabel = [[UILabel alloc] init];
        [self addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self).offset(10);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(60, 20));
        }];
        self.titleLabel.text = @"红球(前区)";
        self.titleLabel.textColor = BY_THEME_COLOR;
        self.titleLabel.font = FONT(12);
    
        UIView *playView = [[UIView alloc] init];
        [self addSubview:playView];
        [playView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(0);
            make.centerY.equalTo(self).offset(0);
            make.size.mas_equalTo(CGSizeMake(75, 20));
        }];
        self.playView = playView;
        
        UILabel *noteLabel = [[UILabel alloc] init];
        [self addSubview:noteLabel];
        [noteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.titleLabel.mas_right).offset(5);
            make.centerY.equalTo(self).offset(0);
            make.right.equalTo(playView.mas_left).offset(-10);
            make.height.mas_equalTo(@20);
        }];
        noteLabel.font = FONT(12);
        noteLabel.textColor = BY_TEXT_COLOR;
        noteLabel.text = @"最少选择五个";
        self.noteLabel = noteLabel;
        
       
        
        UILabel *playLabel = [[UILabel alloc] init];
        [playView addSubview:playLabel];
        [playLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(playView).offset(0);
            make.top.equalTo(playView).offset(0);
            make.bottom.equalTo(playView).offset(0);
            make.left.equalTo(playView).offset(18);
        }];
        playLabel.font = FONT(12);
        playLabel.text = @"玩法说明";
        playLabel.textColor = BY_Blue_COLOR;
        
        UIImageView *imageView = [[UIImageView alloc] init];
        [playView addSubview:imageView];
        [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(playView).offset(0);
            make.centerY.equalTo(playView).offset(0);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        imageView.image = [UIImage imageNamed:@"wanfashuoming"];
        imageView.userInteractionEnabled = YES;
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
        [playView addGestureRecognizer:tap];
        
    }
    return self;
}


- (void)tapAction:(UITapGestureRecognizer *)tap{
    if (self.selectBlock) {
        self.selectBlock();
    }
    
}

@end
